package hd.cls2;

import hd.Dog;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class DogInList {
    public static void main(String[] args) {
        List<Dog> dogs=new ArrayList<>();
        dogs.add(new Dog("大黄",3,"黄"));
        dogs.add(new Dog("2黄",6,"黄"));
        dogs.add(0,new Dog("二黑",6,"黑花"));
        dogs.add(new Dog("老黄",9,"黄"));
        dogs.add(new Dog("刀疤黄",3,"黄"));
        System.out.println(dogs.size());

        Dog d2=new Dog("大黄",3,"蛋黄");
        boolean ex=dogs.contains(d2);
        System.out.println("包含?"+ex);
        for(Dog d: dogs){
            System.out.println(d);
            //System.out.println(d.getName());
        }
    }
}
